<%= render "sider_bar" %>

<%= stylesheet_link_tag 'index'%>
<p id="notice"><%= notice %></p>

<div class="posts pull-left width-66">
  <% if @posts.size.zero? %>
    <%= render 'no_content' %>
  <% else %>
    <% @posts.each do |post| %>
    <div class="post section">
      <div class="post-info">
        <span class="name"><%= post.author.name %></span>
        <span class="on">on</span>
        <time class="create-time"><%= post.created_at.strftime('%b %d, %y') %></time>
      </div>
      <h3 class="post-title">
        <%= link_to post.title, post%>
      </h3>
      <p class="content-abs">
        <%= truncate post.content, :length => 300 %>
      </p>
      <div class="comments-count">共有条 <%= post.comments.size %> 评论</div>
    </div>
    <% end %>

    <div class="pages-nav clear center">
      <%= will_paginate @posts %>
    </div>
  <% end %>
</div>

